﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Magicodes.ExporterAndImporter.Excel.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NP.BPMReportPlatform.Hana;
using NP.BPMReportPlatform.Hana.Dto;
namespace NP.BPMReportPlatform.Hana
{
    /// <summary>
    /// Hana 接口
    /// </summary>
    [Authorize]
    [ApiController]
    [Route("api/Hana")]
    public class HanaController : BPMReportPlatformController
    {
        private readonly IHanaService _hanaService;
        public HanaController(IHanaService hanaService)
        {
            _hanaService = hanaService;
        }

        /// <summary>
        /// 根据客户编码或名称查询客户信息（默认展示10条匹配的数据）
        /// </summary>
        /// <param name="customerCode">客户编码</param>
        /// <returns></returns>
        [HttpGet("GetKNA1CustomerAsync")]
        public async Task<IList<GetKNA1CustomerOutput>> GetKNA1CustomerAsync([FromQuery] string customerCode)
        {
            return await _hanaService.GetKNA1CustomerAsync(customerCode);
        }
    }
}